
var app = getApp();
var Auth = app.modules['Auth'];
var Config = app.config;

var Authorization = 'Authorization';
var TokenPrefix = 'Bearer ';

module.exports = {
    before:function(request){
        if(Auth.user() != null){
            var header = {
                key: Authorization,
                value:TokenPrefix+Auth.identifier()
            };
            request.withHeaders(header);
        }
        
        return true;
    }
}